var order = ['green','red','yellow','blue','green']
Page({
  data:{
    // text:"这是一个页面"
    toView:"green"
  },
  upper:function(e){
      console.log(e)
  },
  lower:function(e){
      console.log(e)
  },
  scroll:function(e){
      console.log(e)
  },
  scrollToTop:function(e){
      this.setAction({
          scrollTop:0
      })
  },
  tap:function(e){
      for(var i = 0; i < order.length; ++i){
          if(order[i] === this.data.toView){
            this.setData({
                toView:order[i+1],
                scrollTop:(i+1)*200
            })
            break
          }
      }
  }
})